import {NzMessageService} from 'ng-zorro-antd';
import {Component, OnInit} from '@angular/core';
import {_HttpClient} from '@delon/theme';

@Component({
    selector: 'app-home',
    templateUrl: './home.html',
    styleUrls: ['./home.less']
})
export class HomeComponent implements OnInit {

    constructor(private http: _HttpClient, public msg: NzMessageService) {
    }

    todoData: any[] = [
        {completed: true, avatar: '1', name: '苏先生', content: `请告诉我，我应该说点什么好？`},
        {completed: false, avatar: '2', name: 'はなさき', content: `ハルカソラトキヘダツヒカリ`},
        {
            completed: false,
            avatar: '3',
            name: 'cipchk',
            content: `this world was never meant for one as beautiful as you.`
        },
        {completed: false, avatar: '4', name: 'Kent', content: `my heart is beating with hers`},
        {
            completed: false,
            avatar: '5',
            name: 'Are you',
            content: `They always said that I love beautiful girl than my friends`
        },
        {completed: false, avatar: '6', name: 'Forever', content: `Walking through green fields ，sunshine in my eyes.`}
    ];

    quickMenu = false;

    webSite: any[] = [];
    salesData: any[] = [];
    offlineChartData: any[] = [];

    ngOnInit() {
        this.http.get('/chart').subscribe((res: any) => {
            this.webSite = res.visitData.slice(0, 10);
            this.salesData = res.salesData;
            this.offlineChartData = res.offlineChartData;
        });

        setTimeout(_ => {
            this.array = [
                './assets/img/logo.svg',
                './assets/img/logo.svg',
                './assets/img/logo.svg',
                './assets/img/logo.svg'];
        }, 500);
    }

    // 近期赞助列表
    recentSupportList = [
        {
            name: '霍宗聖',
            amount: '1000'
        },
        {
            name: '霍宗聖',
            amount: '1000'
        },
        {
            name: '霍宗聖',
            amount: '1000'
        },
        {
            name: '霍宗聖',
            amount: '1000'
        }
    ];

    // 近期合作列表
    recentTogetherList = [
        {
            A: '霍宗聖',
            B: '杨柳'
        },
        {
            A: '霍宗聖',
            B: '杨柳'
        },
        {
            A: '霍宗聖',
            B: '杨柳'
        },
        {
            A: '霍宗聖',
            B: '杨柳'
        },
    ];
    apply = {
        name: '霍宗聖',
        amount: 10000
    };

    array = [];

}
